home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 237
/
237.d81
/
t.free cell
< prev
next >
Wrap
Text File
|
2022-08-26
|
7KB
|
277 lines
u
F R E E C E L L
by Dave Moorman
This solitaire game is -- well --
Free Cell. I tried to include many of
the features found on the Windows
version that comes with most PC
computers. And I added a couple
features of my own.
STARTING THE GAME
-----------------
When you see the "empty" screen,
click on START to start the game. You
can click on X at the upper right
corner of the screen (or press <X>) at
any time to end the game.
When you click START (or press
<S>), you are presented with a Game
Number. Click PLAY to accept that
number, or CHANGE to choose a Game
Number.
Once the game has started,
clicking START will allow you to
Restart the game or start a new game.
PLAYING THE GAME
----------------
The object of Free Cell is to move
all the cards from the tableau to the
Stacks (at the top right of the
screen), beginning with the Ace of
each suit and piling to the King. The
cards may be moved between columns of
the tableau, one card at a time,
placing a given card on a card with
one higher value, with a different
suit color.
You have four "free cells" at the
top left of the screen. Each can hold
one card. By moving cards into the
free cells, then back to the tableau,
you can move columns of ordered cards
from one column to another.
To move a card, click on it. It
will turn yellow. Then click on the
column, free cell, or stack where you
want to put the card.
Double-clicking on a card will
send it to a free cell, if one is
open. If some of the cards in the
chosen stack are in order, one of them
being a legal move, and you have
enough room in free cells and open
columns, the whole column will be
moved with just a point and click.
The UNDO button at the top of the
screen (or press <U>) will take back
ONE move. If you get completely stuck,
click START (press <S>) to Restart the
game.
UNIQUE FEATURES
---------------
One of the reasons I wrote this is
that my Windows game went kaput and I
can't get it to work -- or find
another copy to reinstall. I was
miffed because I had successfully
completed games numbered 1 through
829. My goal was, and still is, to win
all 32000 games.
So I added a feature to this
version that makes such a Series Play
easy to do. RIGHT CLICK on START when
the screen is empty. The first time
you do this, you can input your name
to the list of players. Then you can
choose to Play Game 1. Future games
started with a right click will offer
you your current Game Number. When you
win, the Game Number is incremented.
And, any number of people can keep
track of their personal Series Play.
To add a name, choose New Player. To
move to an existing player, choose
Change Player. Whichever player last
played the game will be welcomed on
the next go-around.
TECHNICAL BLATHER
-----------------
This is the first major use of
DotBASIC for a working entertainment
program. The cards are borrowed from
the great work of the late Maurice
Jones. They are, in my opinion, the
best designed font- graphic cards
ever.
To include the cards in the game,
I monkeyed around with Maurice's
"Michael's Game" to fill a screen with
each suit, then save it. I used VDOT
to touch up the color and tweak a few
pixels, then saved the screens and
font as MED files.
Then, with VOBJECT, I cut out each
card and put it in a Screen Object
Collection file. This is bloaded into
the game and linked. Then each card
can be placed anywhere on the screen
with
.OP,index,x,y.
I have left Free Cell unpacked so
you can look at it, and borrow the
CARDS.SOC file for your own solitaires
and other games. Check out the
DotBASIC documentation to see how to
do this.
Since the Event Driver feature of
DotBASIC is not suited for pointing
and clicking cards, I had to use
Region Define (.RD) to create the
columns, free cells, and stack spaces
on the screen. With the Event Driver
disabled (.ED), I could use this
simple bit of code to wait for the
first click or a keypress:
.DO:.MA:.KP,"sux":.UN CR% or I%
After processing the first click,
I use a similar loop to wait for the
second click. The code is very
efficient. Take a look at lines 1100
to 1199.
However, DotBASIC didn't help one
iota when it came to the logic of the
game, which proved to be a real bear!
I had hoped to devise a way to
literally move columns of cards, one
card at a time to free cells and empty
columns until all could be placed on
the target column.
Alas, I could not get my head
around the complex recursiveness of
it. I was becoming rather recursive
myself -- using the same simple
Anglo-Saxon words over and over as I
pulled my hair. (I must have been
speaking in tongues, because as a
pastor, I have no idea what those
words mean!)
One of the weird things I learned
is that the progression of the maximum
number cards that can be moved,
depending on how many free cells and
how many open columns is strange:
Zero Free Cells:
Column(s) Open Cards Movable
0 1
1 2
2 4
3 7
4 11
5 15
6 22
Each available Free Cell multiplies
these numbers. I put the above table
in an array:
(FC+1)*CZ(COLS)
And all that has to be done is
check that the column is ordered, and
that a movable card is in the column.
This was a whole lot easier than
trying to move individual cards here
and there and back again!
The progression is a second stage
differential of 1:
Progression Add Difference
1
1
2 1
2
4 1
3
7 1
4
11 1
5
16 1
6
22
and so forth. Compare it to the
differential for Squares:
VAL SQR Add Dif
0 0
1
1 1 2
3
2 4 2
5
3 9 2
7
4 16 2
9
5 25
(I don't know why I didn't pay more
attention to math in high school. I
guess I just wasn't ready then. This
stuff is fascinating!)
KUDOS
-----
Again (and forever) a big BIG
thanks to Lee Novak, whose Mr.MOUSE is
at the heart of DotBASIC. I haven't
heard from Lee in some time. He may
well have moved on to other things in
life. It happens. But we send him a
LOADSTAR every month -- because his
Mr.MOUSE and LINK/PACK/DISSOLVE Trio
just keep on giving new life to the
C-64.
And this program is dedicated to
the memory of Maurice Jones, the
Acclaimed Master of Card Game
Simulations. Maurice already had a
Free Cell. This version is a tribute
to him.
DMM